home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Examples / robbotPet / robbit8.wwModel / initialProcs.eve < prev    next >
Encoding:
Text File  |  1995-03-22  |  22.2 KB  |  145 lines

  1. proc calculateSplay {u extend} { 
  2.  
  3.   return [expr {($u * 67.) + (13. * (($extend - 1.)/4.))}]
  4. }
  5.  
  6. proc translateShinyThing {x y z} {  global shinyThing;
  7.    if {$y < $shinyThing(radius)} {set shinyThing(yTranslate) $shinyThing(radius)} {}
  8.    Translate $x $y $z
  9. }
  10.  
  11.  
  12. proc drawLeg {name rotation} {
  13.  
  14.   global leg legTop squishyJoint foot toe
  15.  
  16.   startShape $name
  17.     Rotate $rotation 0 1 0
  18.     # first we move away from the center of the body; out and down
  19.     Translate 0 [expr {-1.5 * $legTop(radius)}] [expr {1.5 * $legTop(radius)}]
  20.     # then rotate about the body to position this leg
  21.     EveCmd {Rotate [calculateSplay $leg(rotate) $squishyJoint(extend)] 1 0 0 }
  22.     #if {$rotation == 180} {  Color {1 0 0}  } {  EveCmd {Color $legTop(color)} } 
  23.     EveCmd {Color $legTop(color)}
  24.     EveCmd {Surface paintedplastic}
  25.     # then draw the upper part of the leg; a hemisphere and cylinder
  26.     EveCmd {Sphere $legTop(radius) $legTop(zMin) $legTop(zMax) $legTop(thetaMax)}
  27.     EveCmd {Cylinder $legTop(radius) 0 $legTop(zMax) $legTop(thetaMax)}
  28.     # we now translate down the leg in z to the end of the cylinder
  29.     EveCmd {Translate 0 0 $legTop(zMax)}
  30.     startShape squishyJoint
  31.       EveCmd {Color $squishyJoint(color)}
  32.       EveCmd {Surface RCRubber}
  33.       set oldFlag [treatAttributeBeginLikeStartShape]
  34.       treatAttributeBeginLikeStartShape 0
  35.       AttributeBegin
  36.         EveCmd {Displacement RCDented}
  37.         EveCmd {Scale 1 1 $squishyJoint(extend)}
  38.         EveCmd {Scale [expr {40 * $legTop(radius)}] [expr {40 * $legTop(radius)}] [expr {40 * $legTop(radius)}] }
  39.         Rotate -90 1 0 0 
  40.         PatchMesh bicubic 49 nonperiodic 12 periodic {P} { 0.025000 0.000000 0.000164 0.025000 0.000000 0.000164 0.020000 -0.002500 0.000000 0.020000 -0.002500 0.000000 0.020000 -0.002500 0.000000 0.025000 -0.005000 0.000000 0.025000 -0.005000 0.000000 0.025000 -0.005000 0.000000 0.020000 -0.007500 0.000000 0.020000 -0.007500 0.000000 0.020000 -0.007500 0.000000 0.025000 -0.010000 0.000000 0.025000 -0.010000 0.000000 0.025000 -0.010000 0.000000 0.020000 -0.012500 0.000000 0.020000 -0.012500 0.000000 0.020000 -0.012500 0.000000 0.025000 -0.015000 0.000000 0.025000 -0.015000 0.000000 0.025000 -0.015000 0.000000 0.020000 -0.017500 0.000000 0.020000 -0.017500 0.000000 0.020000 -0.017500 0.000000 0.025000 -0.020000 0.000000 0.025000 -0.020000 0.000000 0.025000 -0.020000 0.000000 0.020000 -0.022500 0.000000 0.020000 -0.022500 0.000000 0.020000 -0.022500 0.000000 0.025000 -0.025000 0.000000 0.025000 -0.025000 0.000000 0.025000 -0.025000 0.000000 0.020000 -0.027500 0.000000 0.020000 -0.027500 0.000000 0.020000 -0.027500 0.000000 0.025000 -0.030000 0.000000 0.025000 -0.030000 0.000000 0.025000 -0.030000 0.000000 0.020000 -0.032500 0.000000 0.020000 -0.032500 0.000000 0.020000 -0.032500 0.000000 0.025000 -0.035000 0.000000 0.025000 -0.035000 0.000000 0.025000 -0.035000 0.000000 0.020000 -0.037500 0.000000 0.020000 -0.037500 0.000000 0.020000 -0.037500 0.000000 0.025000 -0.040000 0.000000 0.025000 -0.040000 0.000000 0.025000 0.000000 0.014164 0.025000 0.000000 0.014164 0.020000 -0.002500 0.012000 0.020000 -0.002500 0.012000 0.020000 -0.002500 0.012000 0.025000 -0.005000 0.014000 0.025000 -0.005000 0.014000 0.025000 -0.005000 0.014000 0.020000 -0.007500 0.012000 0.020000 -0.007500 0.012000 0.020000 -0.007500 0.012000 0.025000 -0.010000 0.014000 0.025000 -0.010000 0.014000 0.025000 -0.010000 0.014000 0.020000 -0.012500 0.012000 0.020000 -0.012500 0.012000 0.020000 -0.012500 0.012000 0.025000 -0.015000 0.014000 0.025000 -0.015000 0.014000 0.025000 -0.015000 0.014000 0.020000 -0.017500 0.012000 0.020000 -0.017500 0.012000 0.020000 -0.017500 0.012000 0.025000 -0.020000 0.014000 0.025000 -0.020000 0.014000 0.025000 -0.020000 0.014000 0.020000 -0.022500 0.012000 0.020000 -0.022500 0.012000 0.020000 -0.022500 0.012000 0.025000 -0.025000 0.014000 0.025000 -0.025000 0.014000 0.025000 -0.025000 0.014000 0.020000 -0.027500 0.012000 0.020000 -0.027500 0.012000 0.020000 -0.027500 0.012000 0.025000 -0.030000 0.014000 0.025000 -0.030000 0.014000 0.025000 -0.030000 0.014000 0.020000 -0.032500 0.012000 0.020000 -0.032500 0.012000 0.020000 -0.032500 0.012000 0.025000 -0.035000 0.014000 0.025000 -0.035000 0.014000 0.025000 -0.035000 0.014000 0.020000 -0.037500 0.012000 0.020000 -0.037500 0.012000 0.020000 -0.037500 0.012000 0.025000 -0.040000 0.014000 0.025000 -0.040000 0.014000 0.014000 0.000000 0.025164 0.014000 0.000000 0.025164 0.012000 -0.002500 0.020000 0.012000 -0.002500 0.020000 0.012000 -0.002500 0.020000 0.014000 -0.005000 0.025000 0.014000 -0.005000 0.025000 0.014000 -0.005000 0.025000 0.012000 -0.007500 0.020000 0.012000 -0.007500 0.020000 0.012000 -0.007500 0.020000 0.014000 -0.010000 0.025000 0.014000 -0.010000 0.025000 0.014000 -0.010000 0.025000 0.012000 -0.012500 0.020000 0.012000 -0.012500 0.020000 0.012000 -0.012500 0.020000 0.014000 -0.015000 0.025000 0.014000 -0.015000 0.025000 0.014000 -0.015000 0.025000 0.012000 -0.017500 0.020000 0.012000 -0.017500 0.020000 0.012000 -0.017500 0.020000 0.014000 -0.020000 0.025000 0.014000 -0.020000 0.025000 0.014000 -0.020000 0.025000 0.012000 -0.022500 0.020000 0.012000 -0.022500 0.020000 0.012000 -0.022500 0.020000 0.014000 -0.025000 0.025000 0.014000 -0.025000 0.025000 0.014000 -0.025000 0.025000 0.012000 -0.027500 0.020000 0.012000 -0.027500 0.020000 0.012000 -0.027500 0.020000 0.014000 -0.030000 0.025000 0.014000 -0.030000 0.025000 0.014000 -0.030000 0.025000 0.012000 -0.032500 0.020000 0.012000 -0.032500 0.020000 0.012000 -0.032500 0.020000 0.014000 -0.035000 0.025000 0.014000 -0.035000 0.025000 0.014000 -0.035000 0.025000 0.012000 -0.037500 0.020000 0.012000 -0.037500 0.020000 0.012000 -0.037500 0.020000 0.014000 -0.040000 0.025000 0.014000 -0.040000 0.025000 0.000000 0.000000 0.025164 0.000000 0.000000 0.025164 0.000000 -0.002500 0.020000 0.000000 -0.002500 0.020000 0.000000 -0.002500 0.020000 0.000000 -0.005000 0.025000 0.000000 -0.005000 0.025000 0.000000 -0.005000 0.025000 0.000000 -0.007500 0.020000 0.000000 -0.007500 0.020000 0.000000 -0.007500 0.020000 0.000000 -0.010000 0.025000 0.000000 -0.010000 0.025000 0.000000 -0.010000 0.025000 0.000000 -0.012500 0.020000 0.000000 -0.012500 0.020000 0.000000 -0.012500 0.020000 0.000000 -0.015000 0.025000 0.000000 -0.015000 0.025000 0.000000 -0.015000 0.025000 0.000000 -0.017500 0.020000 0.000000 -0.017500 0.020000 0.000000 -0.017500 0.020000 0.000000 -0.020000 0.025000 0.000000 -0.020000 0.025000 0.000000 -0.020000 0.025000 0.000000 -0.022500 0.020000 0.000000 -0.022500 0.020000 0.000000 -0.022500 0.020000 0.000000 -0.025000 0.025000 0.000000 -0.025000 0.025000 0.000000 -0.025000 0.025000 0.000000 -0.027500 0.020000 0.000000 -0.027500 0.020000 0.000000 -0.027500 0.020000 0.000000 -0.030000 0.025000 0.000000 -0.030000 0.025000 0.000000 -0.030000 0.025000 0.000000 -0.032500 0.020000 0.000000 -0.032500 0.020000 0.000000 -0.032500 0.020000 0.000000 -0.035000 0.025000 0.000000 -0.035000 0.025000 0.000000 -0.035000 0.025000 0.000000 -0.037500 0.020000 0.000000 -0.037500 0.020000 0.000000 -0.037500 0.020000 0.000000 -0.040000 0.025000 0.000000 -0.040000 0.025000 -0.014000 0.000000 0.025164 -0.014000 0.000000 0.025164 -0.012000 -0.002500 0.020000 -0.012000 -0.002500 0.020000 -0.012000 -0.002500 0.020000 -0.014000 -0.005000 0.025000 -0.014000 -0.005000 0.025000 -0.014000 -0.005000 0.025000 -0.012000 -0.007500 0.020000 -0.012000 -0.007500 0.020000 -0.012000 -0.007500 0.020000 -0.014000 -0.010000 0.025000 -0.014000 -0.010000 0.025000 -0.014000 -0.010000 0.025000 -0.012000 -0.012500 0.020000 -0.012000 -0.012500 0.020000 -0.012000 -0.012500 0.020000 -0.014000 -0.015000 0.025000 -0.014000 -0.015000 0.025000 -0.014000 -0.015000 0.025000 -0.012000 -0.017500 0.020000 -0.012000 -0.017500 0.020000 -0.012000 -0.017500 0.020000 -0.014000 -0.020000 0.025000 -0.014000 -0.020000 0.025000 -0.014000 -0.020000 0.025000 -0.012000 -0.022500 0.020000 -0.012000 -0.022500 0.020000 -0.012000 -0.022500 0.020000 -0.014000 -0.025000 0.025000 -0.014000 -0.025000 0.025000 -0.014000 -0.025000 0.025000 -0.012000 -0.027500 0.020000 -0.012000 -0.027500 0.020000 -0.012000 -0.027500 0.020000 -0.014000 -0.030000 0.025000 -0.014000 -0.030000 0.025000 -0.014000 -0.030000 0.025000 -0.012000 -0.032500 0.020000 -0.012000 -0.032500 0.020000 -0.012000 -0.032500 0.020000 -0.014000 -0.035000 0.025000 -0.014000 -0.035000 0.025000 -0.014000 -0.035000 0.025000 -0.012000 -0.037500 0.020000 -0.012000 -0.037500 0.020000 -0.012000 -0.037500 0.020000 -0.014000 -0.040000 0.025000 -0.014000 -0.040000 0.025000 -0.025000 0.000000 0.014164 -0.025000 0.000000 0.014164 -0.020000 -0.002500 0.012000 -0.020000 -0.002500 0.012000 -0.020000 -0.002500 0.012000 -0.025000 -0.005000 0.014000 -0.025000 -0.005000 0.014000 -0.025000 -0.005000 0.014000 -0.020000 -0.007500 0.012000 -0.020000 -0.007500 0.012000 -0.020000 -0.007500 0.012000 -0.025000 -0.010000 0.014000 -0.025000 -0.010000 0.014000 -0.025000 -0.010000 0.014000 -0.020000 -0.012500 0.012000 -0.020000 -0.012500 0.012000 -0.020000 -0.012500 0.012000 -0.025000 -0.015000 0.014000 -0.025000 -0.015000 0.014000 -0.025000 -0.015000 0.014000 -0.020000 -0.017500 0.012000 -0.020000 -0.017500 0.012000 -0.020000 -0.017500 0.012000 -0.025000 -0.020000 0.014000 -0.025000 -0.020000 0.014000 -0.025000 -0.020000 0.014000 -0.020000 -0.022500 0.012000 -0.020000 -0.022500 0.012000 -0.020000 -0.022500 0.012000 -0.025000 -0.025000 0.014000 -0.025000 -0.025000 0.014000 -0.025000 -0.025000 0.014000 -0.020000 -0.027500 0.012000 -0.020000 -0.027500 0.012000 -0.020000 -0.027500 0.012000 -0.025000 -0.030000 0.014000 -0.025000 -0.030000 0.014000 -0.025000 -0.030000 0.014000 -0.020000 -0.032500 0.012000 -0.020000 -0.032500 0.012000 -0.020000 -0.032500 0.012000 -0.025000 -0.035000 0.014000 -0.025000 -0.035000 0.014000 -0.025000 -0.035000 0.014000 -0.020000 -0.037500 0.012000 -0.020000 -0.037500 0.012000 -0.020000 -0.037500 0.012000 -0.025000 -0.040000 0.014000 -0.025000 -0.040000 0.014000 -0.025000 0.000000 0.000164 -0.025000 0.000000 0.000164 -0.020000 -0.002500 0.000000 -0.020000 -0.002500 0.000000 -0.020000 -0.002500 0.000000 -0.025000 -0.005000 0.000000 -0.025000 -0.005000 0.000000 -0.025000 -0.005000 0.000000 -0.020000 -0.007500 0.000000 -0.020000 -0.007500 0.000000 -0.020000 -0.007500 0.000000 -0.025000 -0.010000 0.000000 -0.025000 -0.010000 0.000000 -0.025000 -0.010000 0.000000 -0.020000 -0.012500 0.000000 -0.020000 -0.012500 0.000000 -0.020000 -0.012500 0.000000 -0.025000 -0.015000 0.000000 -0.025000 -0.015000 0.000000 -0.025000 -0.015000 0.000000 -0.020000 -0.017500 0.000000 -0.020000 -0.017500 0.000000 -0.020000 -0.017500 0.000000 -0.025000 -0.020000 0.000000 -0.025000 -0.020000 0.000000 -0.025000 -0.020000 0.000000 -0.020000 -0.022500 0.000000 -0.020000 -0.022500 0.000000 -0.020000 -0.022500 0.000000 -0.025000 -0.025000 0.000000 -0.025000 -0.025000 0.000000 -0.025000 -0.025000 0.000000 -0.020000 -0.027500 0.000000 -0.020000 -0.027500 0.000000 -0.020000 -0.027500 0.000000 -0.025000 -0.030000 0.000000 -0.025000 -0.030000 0.000000 -0.025000 -0.030000 0.000000 -0.020000 -0.032500 0.000000 -0.020000 -0.032500 0.000000 -0.020000 -0.032500 0.000000 -0.025000 -0.035000 0.000000 -0.025000 -0.035000 0.000000 -0.025000 -0.035000 0.000000 -0.020000 -0.037500 0.000000 -0.020000 -0.037500 0.000000 -0.020000 -0.037500 0.000000 -0.025000 -0.040000 0.000000 -0.025000 -0.040000 0.000000 -0.025000 0.000000 -0.013836 -0.025000 0.000000 -0.013836 -0.020000 -0.002500 -0.012000 -0.020000 -0.002500 -0.012000 -0.020000 -0.002500 -0.012000 -0.025000 -0.005000 -0.014000 -0.025000 -0.005000 -0.014000 -0.025000 -0.005000 -0.014000 -0.020000 -0.007500 -0.012000 -0.020000 -0.007500 -0.012000 -0.020000 -0.007500 -0.012000 -0.025000 -0.010000 -0.014000 -0.025000 -0.010000 -0.014000 -0.025000 -0.010000 -0.014000 -0.020000 -0.012500 -0.012000 -0.020000 -0.012500 -0.012000 -0.020000 -0.012500 -0.012000 -0.025000 -0.015000 -0.014000 -0.025000 -0.015000 -0.014000 -0.025000 -0.015000 -0.014000 -0.020000 -0.017500 -0.012000 -0.020000 -0.017500 -0.012000 -0.020000 -0.017500 -0.012000 -0.025000 -0.020000 -0.014000 -0.025000 -0.020000 -0.014000 -0.025000 -0.020000 -0.014000 -0.020000 -0.022500 -0.012000 -0.020000 -0.022500 -0.012000 -0.020000 -0.022500 -0.012000 -0.025000 -0.025000 -0.014000 -0.025000 -0.025000 -0.014000 -0.025000 -0.025000 -0.014000 -0.020000 -0.027500 -0.012000 -0.020000 -0.027500 -0.012000 -0.020000 -0.027500 -0.012000 -0.025000 -0.030000 -0.014000 -0.025000 -0.030000 -0.014000 -0.025000 -0.030000 -0.014000 -0.020000 -0.032500 -0.012000 -0.020000 -0.032500 -0.012000 -0.020000 -0.032500 -0.012000 -0.025000 -0.035000 -0.014000 -0.025000 -0.035000 -0.014000 -0.025000 -0.035000 -0.014000 -0.020000 -0.037500 -0.012000 -0.020000 -0.037500 -0.012000 -0.020000 -0.037500 -0.012000 -0.025000 -0.040000 -0.014000 -0.025000 -0.040000 -0.014000 -0.014000 0.000000 -0.024836 -0.014000 0.000000 -0.024836 -0.012000 -0.002500 -0.020000 -0.012000 -0.002500 -0.020000 -0.012000 -0.002500 -0.020000 -0.014000 -0.005000 -0.025000 -0.014000 -0.005000 -0.025000 -0.014000 -0.005000 -0.025000 -0.012000 -0.007500 -0.020000 -0.012000 -0.007500 -0.020000 -0.012000 -0.007500 -0.020000 -0.014000 -0.010000 -0.025000 -0.014000 -0.010000 -0.025000 -0.014000 -0.010000 -0.025000 -0.012000 -0.012500 -0.020000 -0.012000 -0.012500 -0.020000 -0.012000 -0.012500 -0.020000 -0.014000 -0.015000 -0.025000 -0.014000 -0.015000 -0.025000 -0.014000 -0.015000 -0.025000 -0.012000 -0.017500 -0.020000 -0.012000 -0.017500 -0.020000 -0.012000 -0.017500 -0.020000 -0.014000 -0.020000 -0.025000 -0.014000 -0.020000 -0.025000 -0.014000 -0.020000 -0.025000 -0.012000 -0.022500 -0.020000 -0.012000 -0.022500 -0.020000 -0.012000 -0.022500 -0.020000 -0.014000 -0.025000 -0.025000 -0.014000 -0.025000 -0.025000 -0.014000 -0.025000 -0.025000 -0.012000 -0.027500 -0.020000 -0.012000 -0.027500 -0.020000 -0.012000 -0.027500 -0.020000 -0.014000 -0.030000 -0.025000 -0.014000 -0.030000 -0.025000 -0.014000 -0.030000 -0.025000 -0.012000 -0.032500 -0.020000 -0.012000 -0.032500 -0.020000 -0.012000 -0.032500 -0.020000 -0.014000 -0.035000 -0.025000 -0.014000 -0.035000 -0.025000 -0.014000 -0.035000 -0.025000 -0.012000 -0.037500 -0.020000 -0.012000 -0.037500 -0.020000 -0.012000 -0.037500 -0.020000 -0.014000 -0.040000 -0.025000 -0.014000 -0.040000 -0.025000 0.000000 0.000000 -0.024836 0.000000 0.000000 -0.024836 0.000000 -0.002500 -0.020000 0.000000 -0.002500 -0.020000 0.000000 -0.002500 -0.020000 0.000000 -0.005000 -0.025000 0.000000 -0.005000 -0.025000 0.000000 -0.005000 -0.025000 0.000000 -0.007500 -0.020000 0.000000 -0.007500 -0.020000 0.000000 -0.007500 -0.020000 0.000000 -0.010000 -0.025000 0.000000 -0.010000 -0.025000 0.000000 -0.010000 -0.025000 0.000000 -0.012500 -0.020000 0.000000 -0.012500 -0.020000 0.000000 -0.012500 -0.020000 0.000000 -0.015000 -0.025000 0.000000 -0.015000 -0.025000 0.000000 -0.015000 -0.025000 0.000000 -0.017500 -0.020000 0.000000 -0.017500 -0.020000 0.000000 -0.017500 -0.020000 0.000000 -0.020000 -0.025000 0.000000 -0.020000 -0.025000 0.000000 -0.020000 -0.025000 0.000000 -0.022500 -0.020000 0.000000 -0.022500 -0.020000 0.000000 -0.022500 -0.020000 0.000000 -0.025000 -0.025000 0.000000 -0.025000 -0.025000 0.000000 -0.025000 -0.025000 0.000000 -0.027500 -0.020000 0.000000 -0.027500 -0.020000 0.000000 -0.027500 -0.020000 0.000000 -0.030000 -0.025000 0.000000 -0.030000 -0.025000 0.000000 -0.030000 -0.025000 0.000000 -0.032500 -0.020000 0.000000 -0.032500 -0.020000 0.000000 -0.032500 -0.020000 0.000000 -0.035000 -0.025000 0.000000 -0.035000 -0.025000 0.000000 -0.035000 -0.025000 0.000000 -0.037500 -0.020000 0.000000 -0.037500 -0.020000 0.000000 -0.037500 -0.020000 0.000000 -0.040000 -0.025000 0.000000 -0.040000 -0.025000 0.014000 0.000000 -0.024836 0.014000 0.000000 -0.024836 0.012000 -0.002500 -0.020000 0.012000 -0.002500 -0.020000 0.012000 -0.002500 -0.020000 0.014000 -0.005000 -0.025000 0.014000 -0.005000 -0.025000 0.014000 -0.005000 -0.025000 0.012000 -0.007500 -0.020000 0.012000 -0.007500 -0.020000 0.012000 -0.007500 -0.020000 0.014000 -0.010000 -0.025000 0.014000 -0.010000 -0.025000 0.014000 -0.010000 -0.025000 0.012000 -0.012500 -0.020000 0.012000 -0.012500 -0.020000 0.012000 -0.012500 -0.020000 0.014000 -0.015000 -0.025000 0.014000 -0.015000 -0.025000 0.014000 -0.015000 -0.025000 0.012000 -0.017500 -0.020000 0.012000 -0.017500 -0.020000 0.012000 -0.017500 -0.020000 0.014000 -0.020000 -0.025000 0.014000 -0.020000 -0.025000 0.014000 -0.020000 -0.025000 0.012000 -0.022500 -0.020000 0.012000 -0.022500 -0.020000 0.012000 -0.022500 -0.020000 0.014000 -0.025000 -0.025000 0.014000 -0.025000 -0.025000 0.014000 -0.025000 -0.025000 0.012000 -0.027500 -0.020000 0.012000 -0.027500 -0.020000 0.012000 -0.027500 -0.020000 0.014000 -0.030000 -0.025000 0.014000 -0.030000 -0.025000 0.014000 -0.030000 -0.025000 0.012000 -0.032500 -0.020000 0.012000 -0.032500 -0.020000 0.012000 -0.032500 -0.020000 0.014000 -0.035000 -0.025000 0.014000 -0.035000 -0.025000 0.014000 -0.035000 -0.025000 0.012000 -0.037500 -0.020000 0.012000 -0.037500 -0.020000 0.012000 -0.037500 -0.020000 0.014000 -0.040000 -0.025000 0.014000 -0.040000 -0.025000 0.025000 0.000000 -0.013836 0.025000 0.000000 -0.013836 0.020000 -0.002500 -0.012000 0.020000 -0.002500 -0.012000 0.020000 -0.002500 -0.012000 0.025000 -0.005000 -0.014000 0.025000 -0.005000 -0.014000 0.025000 -0.005000 -0.014000 0.020000 -0.007500 -0.012000 0.020000 -0.007500 -0.012000 0.020000 -0.007500 -0.012000 0.025000 -0.010000 -0.014000 0.025000 -0.010000 -0.014000 0.025000 -0.010000 -0.014000 0.020000 -0.012500 -0.012000 0.020000 -0.012500 -0.012000 0.020000 -0.012500 -0.012000 0.025000 -0.015000 -0.014000 0.025000 -0.015000 -0.014000 0.025000 -0.015000 -0.014000 0.020000 -0.017500 -0.012000 0.020000 -0.017500 -0.012000 0.020000 -0.017500 -0.012000 0.025000 -0.020000 -0.014000 0.025000 -0.020000 -0.014000 0.025000 -0.020000 -0.014000 0.020000 -0.022500 -0.012000 0.020000 -0.022500 -0.012000 0.020000 -0.022500 -0.012000 0.025000 -0.025000 -0.014000 0.025000 -0.025000 -0.014000 0.025000 -0.025000 -0.014000 0.020000 -0.027500 -0.012000 0.020000 -0.027500 -0.012000 0.020000 -0.027500 -0.012000 0.025000 -0.030000 -0.014000 0.025000 -0.030000 -0.014000 0.025000 -0.030000 -0.014000 0.020000 -0.032500 -0.012000 0.020000 -0.032500 -0.012000 0.020000 -0.032500 -0.012000 0.025000 -0.035000 -0.014000 0.025000 -0.035000 -0.014000 0.025000 -0.035000 -0.014000 0.020000 -0.037500 -0.012000 0.020000 -0.037500 -0.012000 0.020000 -0.037500 -0.012000 0.025000 -0.040000 -0.014000 0.025000 -0.040000 -0.014000 } ;
  41.       AttributeEnd
  42.       treatAttributeBeginLikeStartShape $oldFlag
  43.       # this then *should* translate us down to the end of the squishy joint.
  44.       #EveCmd {Translate 0 [expr {-1 * $legTop(radius)}] [expr {(2.5 * $legTop(radius)) + ($squishyJoint(extend) * $legTop(radius))}]}
  45.       EveCmd {Translate 0 [expr {-1 * $legTop(radius)}] 0}
  46.       EveCmd {Translate 0 0 [expr {(2.5 * $legTop(radius)) + ($squishyJoint(extend) * $legTop(radius))}]}
  47.       startShape ankle
  48.         EveCmd {Rotate [expr {-1 * [calculateSplay $leg(rotate) $squishyJoint(extend)]}] 1 0 0 }
  49.         EveCmd {Color $foot(color)}
  50.         EveCmd {Surface paintedplastic}
  51.         Scale .8 1 1
  52.         startShape foot
  53.           EveCmd {Rotate $foot(twist) 0 1 0}
  54.           # okay, we want the following translate in Z to be modulated by 0 to 90
  55.           # when $leg(rotate) == 0, the translate equals 0
  56.           EveCmd {Translate 0 0 [expr {$leg(rotate) * (2 * $legTop(radius))}]}
  57.           EveCmd {Sphere [expr {3 * $legTop(radius)}] [expr {3 * $legTop(zMin)}] [expr {3 * $legTop(zMax)}] 180}
  58.           TransformBegin
  59.              EveCmd {Rotate 90 1 0 0 }
  60.              EveCmd {Surface matte}
  61.              EveCmd {Disk 0 [expr {3 * $legTop(radius)}] 360}
  62.           TransformEnd
  63.           EveCmd {Translate 0 0 $legTop(radius) }
  64.           startShape bigToe
  65.             Color {0 0 0}
  66.             EveCmd {Surface RCMetal}
  67.             EveCmd {Sphere [expr {2.25 * $legTop(radius)}] [expr {2.25 * $legTop(zMin)}] [expr {2.25 * $legTop(zMax)}] 180}
  68.             EveCmd {Rotate 90 1 0 0 }
  69.             EveCmd {Color $foot(color)}
  70.             EveCmd {Surface matte}
  71.             EveCmd {Disk 0 [expr {2.25 * $legTop(radius)}] 360}
  72.           endShape
  73.           startShape littleToeA
  74.             Color {1 1 1}
  75.             Rotate 25 0 1 0
  76.             EveCmd {Surface RCMetal}
  77.             EveCmd {Translate 0 0 [expr {1.75 * $legTop(radius)}]}
  78.             EveCmd {Sphere [expr {.6 * $legTop(radius)}] [expr {.6 * $legTop(zMin)}] [expr {.6 * $legTop(zMax)}] 180}
  79.             EveCmd {Rotate 90 1 0 0 }
  80.             EveCmd {Color $toe(color)}
  81.             EveCmd {Surface matte}
  82.             EveCmd {Disk 0 [expr {.6 * $legTop(radius)}] 360}
  83.           endShape
  84.           startShape littleToeB
  85.             Color {1 1 1}
  86.             Rotate -25 0 1 0
  87.             EveCmd {Surface RCMetal}
  88.             EveCmd {Translate 0 0 [expr {1.75 * $legTop(radius)}]}
  89.             EveCmd {Sphere [expr {.6 * $legTop(radius)}] [expr {.6 * $legTop(zMin)}] [expr {.6 * $legTop(zMax)}] 180}
  90.             EveCmd {Rotate 90 1 0 0 }
  91.             EveCmd {Color $toe(color)}
  92.             EveCmd {Surface matte}
  93.             EveCmd {Disk 0 [expr {.6 * $legTop(radius)}] 360}
  94.           endShape
  95.           startShape littleToeC
  96.             Color {1 1 1}
  97.             EveCmd {Surface RCMetal}
  98.             EveCmd {Translate 0 0 [expr {1.75 * $legTop(radius)}]}
  99.             EveCmd {Sphere [expr {.6 * $legTop(radius)}] [expr {.6 * $legTop(zMin)}] [expr {.6 * $legTop(zMax)}] 180}
  100.             EveCmd {Rotate 90 1 0 0 }
  101.             EveCmd {Color $toe(color)}
  102.             EveCmd {Surface matte}
  103.             EveCmd {Disk 0 [expr {.6 * $legTop(radius)}] 360}
  104.           endShape
  105.         endShape
  106.       endShape
  107.     endShape
  108.   endShape
  109. }
  110.  
  111.  
  112. proc tailSag {sag splay} {
  113.  
  114.   if {$sag > -10} \
  115.   {  Rotate [expr {($sag * $splay) - 10}] 1 0 0 ;
  116.   } \
  117.   {  Rotate $sag 1 0 0 ;
  118.   }
  119. }
  120.  
  121. # so here's the deal: when downUpAngle is negative, we have to
  122. # modulate it's value by the splay value.  When $splay is 90, the
  123. # modulation factor is 0, but when splay drops to 0, the modulation goes
  124. # to 1.  Said another way, if $splay is 90, we can leave the downUp
  125. # Angle alone, but the closer splay moves to zero,
  126.  
  127. # at splay 0 and extend is 1, we want to max downUpAngle at 12
  128. # at splay .7, we want to max downUpAngle at -26
  129. # at splay .5, -18
  130. # at splay 0, extend is 5, max should be -5
  131. # at splay 0, extend is 1, max should be -45
  132.  
  133. # so there's a (-40 * (($extend - 1)/4)) goes from 0 to 1
  134.  
  135.  
  136. proc lookDownOrUp {downUpAngle splay extend} {
  137.  
  138.   if {$downUpAngle <= 8} \
  139.   {  Rotate [expr {8 - ($downUpAngle * $splay)}] 1 0 0 ;
  140.   } \
  141.   {  Rotate $downUpAngle 1 0 0 ;
  142.   }
  143. }
  144.  
  145.